<template>
  <div class="fh-page">
    <div class="fh-notice" v-if="notice"></div>
    <div class="fh-router-view">
      <div class="fh-router-view-silder" :style="{ width: silderWidth + 'px' }">
        <!-- <svgIcon class="collapsible"/> -->
        <svg-icon :icon-class="collapsible" class="collapsible" @click="changeIcon" />
        <silder-menu :collapsible="collapsible" />
      </div>
      <div class="fh-router-view-container">
        <svg-icon icon-class="logo" />
        <RouterView />
      </div>
    </div>
  </div>
</template>
<script>
import RouterView from "./RouterView";
import { silderMenu } from "@/components";
export default {
  name: "BasicLayout",
  components: {
    RouterView,
    silderMenu
  },
  methods: {
    changeIcon() {
      this.collapsible =
        this.collapsible == "collapsible"
          ? "collapsible-active"
          : "collapsible";
      this.silderWidth = this.silderWidth == 140 ? 0 : 140;
    }
  },
  data() {
    return {
      silderWidth: 140, // 侧边宽度
      collapsible: "collapsible", // 图标类名
      notice: false // 是否有新通知
    };
  }
};
</script>
<style lang="less" scoped>
.fh-page {
  display: flex;
  height: 100%;
  background: #dee0ed;
  flex-direction: column;
}
.fh-notice {
  width: 100%;
  height: 40px;
  background: #10398e;
}
.fh-router-view {
  flex: 1;
}

.fh-router-view {
  display: flex;
  height: 100%;
}

.fh-router-view-silder {
  height: 100%;
  position: relative;
  transition: all 0.2s ease;
}

.fh-router-view-container {
  flex: 1;
  height: 100%;
}

.collapsible {
  position: absolute;
  right: 0;
  width: 29px;
  height: 59px;
  cursor: pointer;
  right: -29px;
  top: 50px;
}
</style>
